package cn.jzq.kotoba.modules.designpattern2.strategy;

import java.util.ArrayList;
import java.util.List;

/**
 * @author jzq
 * @date 2019/4/16 15:10
 */
public class App {

    public static void main(String[] args) {
        Elf elf = new Elf();
        DragonSlayer knight = new Knight();

        List<DragonSlayer> dragonSlayers = new ArrayList<>();
        dragonSlayers.add(elf);
        dragonSlayers.add(knight);
        System.out.println("前方出现巨龙, 战斗开始");
        dragonSlayers.forEach(dragonSlayer -> {
            dragonSlayer.goToBattle();
            dragonSlayer.jump();
//            dragonSlayer.userHolyWater();
//            dragonSlayer.battleWithBow();
        });


        elf.setShootBehavior(new ShootWithRow());
        elf.battleWithBow();

    }
}
